/*
 * @Description: 面试题
 * @Date: 2022-05-06 11:06:23
 * @LastEditTime: 2022-06-01 11:24:03
 * @FilePath: /测试文档(总结)/31.js
 * @Author: byhzdemacbook-pro-2.local
 */
var name = "word";
(function(){
  var name;
  if(typeof name === "undefined") {
    name = "jack";
    console.log("goodbye"+name);
  }else {
    console.log("hello"+name);
  }
})()

const url = "http://172.18.33.200:8086/geoserver/cbjy_/wms?ss"
const num = url.indexOf("geoserver")
const xxx = url.split("").splice(num).join("")
console.log(num);
console.log(xxx);

const s = url.indexOf("wms")
const ss = url.indexOf("geoserver")
const m = 10 + ss
const j = s- m -1
const x = url.split("").splice(m,j).join("")
console.log("s--->",s);
console.log("ss--->",ss);
console.log("m--->",m);
console.log("x--->",x);




var obj1 = {a:1};
var obj2 = {b:2};
var newObj = Object.assign(obj1,obj2);
console.log(newObj) //{ a: 1, b: 2 }